package com.dachuang.canjiren.controller;


import com.dachuang.canjiren.service.LawService;
import com.dachuang.canjiren.service.MessageService;
import com.dachuang.common.utils.R;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;

import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

/**
 * <p>
 *  前端控制器
 * </p>
 *
 * @author testjava
 * @since 2020-07-27
 */
@RestController
@RequestMapping("/canjiren/message")
public class MessageController {

    @Autowired
    private MessageService messageService;

    @GetMapping(value = "insertMessage")
    R insertMessage(
            @RequestParam(value = "sendId", required = false) Integer sendId,
            @RequestParam(value = "secId", required = false) Integer secId,
            @RequestParam(value = "content", required = false) String content) {
        return messageService.insertMessage(sendId,secId,content);
    }

    @GetMapping("selectMessage")
    R selectMessage(Integer id){
        return messageService.selectMessage(id);
    }
}

